package com.example.book.model;

import lombok.Data;

@Data
public class PageRequest {
    private Integer pageNum =1;
    private Integer pageSize = 10;
    private Integer offset;

    public PageRequest() {
    }

    public PageRequest(Integer pageNum, Integer pageSize, Integer offset) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.offset = offset;
    }

    public Integer getOffset() {
        return (pageNum-1) * pageSize;
    }
}
